*WB gender data .do
clear
wbopendata, language(en - English) country() topics() indicator(SP.ADO.TFRT) long
label var sp_ado_tfrt "Adolescent fertility rate (births per 1,000 women ages 15-19)"
rename sp_ado_tfrt Adolescentfertilityratebirth
save "Adolescent Fertility Rate.dta", replace
clear
wbopendata, language(en - English) country() topics() indicator(SL.TLF.CACT.FM.ZS) long
joinby countrycode year using "Adolescent Fertility Rate.dta", unmatched(master)
label var sl_tlf_cact_fm_zs " Ratio of female to male labor force participation rate (%) (modeled ILO estimate)"
rename sl_tlf_cact_fm_zs Ratiooffemaletomalelaborfo

gen lag2=year

**use countrynames to code dofile for rest.***

gen cowcode=.
replace cowcode=816 if countrycode=="VDR"
replace cowcode=680 if countrycode=="YMD"
replace cowcode=371 if countrycode=="ARM"
replace cowcode=900 if countrycode=="AUS"
replace cowcode=305 if countrycode=="AUT"
replace cowcode=771 if countrycode=="BAN"
replace cowcode=211 if countrycode=="BEL"
replace cowcode=370 if countrycode=="BLR"
replace cowcode=439 if countrycode=="BUR"
replace cowcode=811 if countrycode=="CAM"
replace cowcode=20 if countrycode=="CAN"
replace cowcode=484 if countrycode=="CGO"
replace cowcode=483 if countrycode=="CHA"
replace cowcode=710 if countrycode=="CHN"
replace cowcode=437 if countrycode=="CIV"
replace cowcode=490 if countrycode=="COD"
replace cowcode=94 if countrycode=="CRC"
replace cowcode=315 if countrycode=="CSK"
replace cowcode=390 if countrycode=="DEN"
replace cowcode=92 if countrycode=="ESA"
replace cowcode=230 if countrycode=="ESP"
replace cowcode=375 if countrycode=="FIN"
replace cowcode=220 if countrycode=="FRA"
replace cowcode=200 if countrycode=="GBR"
replace cowcode=265 if countrycode=="GDR"
replace cowcode=260 if countrycode=="GFR"
replace cowcode=350 if countrycode=="GRE"
replace cowcode=850 if countrycode=="INA"
replace cowcode=630 if countrycode=="IRI"
replace cowcode=205 if countrycode=="IRL"
replace cowcode=666 if countrycode=="ISR"
replace cowcode=325 if countrycode=="ITA"
replace  cowcode=740 if countrycode=="JPN"
replace cowcode=703 if countrycode=="KGZ"
replace cowcode=732 if countrycode=="KOR"
replace cowcode=670 if countrycode=="KSA"
replace cowcode=620 if countrycode=="LBA"
replace cowcode=450 if countrycode=="LBR"
replace cowcode=368 if countrycode=="LTU"
replace cowcode=580 if countrycode=="MAD"
replace cowcode=820 if countrycode=="MAS"
replace cowcode=553 if countrycode=="MAW"
replace cowcode=359 if countrycode=="MDA"
replace cowcode=712 if countrycode=="MGL"
replace cowcode=343 if countrycode=="MKD"
replace cowcode=341 if countrycode=="MNE"
replace cowcode=590 if countrycode=="MRI"
replace cowcode=435 if countrycode=="MTN"
replace cowcode=93 if countrycode=="NCA"
replace cowcode=210 if countrycode=="NED"
replace cowcode=475 if countrycode=="NGR"
replace cowcode=436 if countrycode=="NIG"
replace cowcode=385 if countrycode=="NOR"
replace cowcode=790 if countrycode=="NPL"
replace cowcode=920 if countrycode=="NZL"
replace cowcode=235 if countrycode=="POR"
replace cowcode=731 if countrycode=="PRK"
replace cowcode=360 if countrycode=="ROU"
replace cowcode=560 if countrycode=="RSA"
replace cowcode=. if countrycode=="SCG"
replace cowcode=900 if countrycode=="AUS"
replace cowcode=451 if countrycode=="SLE"
replace cowcode=. if countrycode=="SRB"
replace cowcode=780 if countrycode=="SRI"
replace cowcode=225 if countrycode=="SUI"
replace cowcode=317 if countrycode=="SVK"
replace cowcode=349 if countrycode=="SLO"
replace cowcode=380 if countrycode=="SWE"
replace cowcode=572 if countrycode=="SWZ"
replace cowcode=510 if countrycode=="TAN"
replace cowcode=702 if countrycode=="TJK"
replace cowcode=701 if countrycode=="TKM"
replace cowcode=. if countrycode=="USSR"
replace cowcode=816 if countrycode=="VDR"
replace cowcode=680 if countrycode=="YMD"
replace cowcode=678 if countrycode=="YMN"

*
replace cowcode=516 if countrycode=="BDI"
replace cowcode=346 if countrycode=="BIH"
replace cowcode=482 if countrycode=="CAF"
replace cowcode=471 if countrycode=="CMR"
replace cowcode=404 if countrycode=="GBS"
replace cowcode=372 if countrycode=="GEO"
replace cowcode=255 if countrycode=="GER"
replace cowcode=705 if countrycode=="KAZ"
replace cowcode=600 if countrycode=="MAR"
replace cowcode=541 if countrycode=="MOZ"
replace cowcode=800 if countrycode=="THA"
replace cowcode=.4 if countrycode=="VIE"
replace cowcode=660 if countrycode=="LIB"
replace cowcode=305 if countrycode=="AUT"
replace cowcode=771 if countrycode=="BAN"
replace cowcode=516 if countrycode=="BDI"
replace cowcode=346 if countrycode=="BIH"
replace cowcode=439 if countrycode=="BUR"
replace cowcode=482 if countrycode=="CAF"
replace cowcode=484 if countrycode=="CGO"
replace cowcode=437 if countrycode=="CIV"
replace cowcode=471 if countrycode=="CMR"
replace cowcode=490 if countrycode=="COD"
replace cowcode=94 if countrycode=="CRC"
replace cowcode=315 if countrycode=="CSK"
replace cowcode=92 if countrycode=="ESA"
replace cowcode=230 if countrycode=="ESP"
replace cowcode=220 if countrycode=="FRA"
replace cowcode=200 if countrycode=="GBR"
replace cowcode=404 if countrycode=="GBS"
replace cowcode=372 if countrycode=="GEO"
replace cowcode=255 if countrycode=="GER"
replace cowcode=350 if countrycode=="GRE"
replace cowcode=850 if countrycode=="INA"
replace cowcode=630 if countrycode=="IRI"
replace cowcode=205 if countrycode=="IRL"
replace cowcode=705 if countrycode=="KAZ"
replace cowcode=703 if countrycode=="KGZ"
replace cowcode=670 if countrycode=="KSA"
replace cowcode=620 if countrycode=="LBA"
replace cowcode=368 if countrycode=="LTU"
replace cowcode=600 if countrycode=="MAR"
replace cowcode=359 if countrycode=="MDA"
replace cowcode=712 if countrycode=="MGL"
replace cowcode=343 if countrycode=="MKD"
replace cowcode=341 if countrycode=="MNE"
replace cowcode=541 if countrycode=="MOZ"
replace cowcode=590 if countrycode=="MRI"
replace cowcode=435 if countrycode=="MTN"
replace cowcode=93 if countrycode=="NCA"
replace cowcode=210 if countrycode=="NED"
replace cowcode=475 if countrycode=="NGR"
replace cowcode=790 if countrycode=="NPL"
replace cowcode=920 if countrycode=="NZL"
replace cowcode=360 if countrycode=="ROU"
replace cowcode=560 if countrycode=="RSA"
replace cowcode=. if countrycode=="SCG"
replace cowcode=451 if countrycode=="SLE"
replace cowcode=. if countrycode=="SRB"
replace cowcode=225 if countrycode=="SUI"
replace cowcode=317 if countrycode=="SVK"
replace cowcode=380 if countrycode=="SWE"
replace cowcode=510 if countrycode=="TAN"
replace cowcode=800 if countrycode=="THA"
replace cowcode=702 if countrycode=="TJK"
replace cowcode=365 if countrycode=="USSR"
replace cowcode=816 if countrycode=="VDR"
replace cowcode=. if countrycode=="VIE"
replace cowcode=678 if countrycode=="YMN"




gen country=countryname

replace cowcode = 2 if country=="United States"
replace cowcode = 2 if country=="USA"

replace cowcode = 20 if country == "Canada"

replace cowcode = 31 if country=="Bahamas, The"
replace cowcode = 31 if country=="Bahamas"

replace cowcode = 40 if country=="Cuba"

replace cowcode = 41 if country == "Haiti"

replace cowcode = 42 if country == "Dominican Republic"
replace cowcode = 42 if country == "Dominican Rep."

replace cowcode = 51 if country == "Jamaica"
replace cowcode = 51 if country == "Jamaica "


replace cowcode = 52 if country == "Trinidad and Tobago"
replace cowcode = 52 if country == "Trinidad &Tobago"
replace cowcode = 52 if country == "Trinidad & Tobago"


replace cowcode = 53 if country == "Barbados"

replace cowcode = 54 if country == "Dominica"
replace cowcode = 54 if country == "Dominica "


replace cowcode = 55 if country == "Grenada"

replace cowcode = 56 if country == "St. Lucia"|country=="Saint Lucia"
replace cowcode = 56 if country == "St. Lucia"|country=="Saint Lucia"|country=="Saint Lucia "


replace cowcode = 57 if country == "St. Vincent and the Grenadines"
replace cowcode = 57 if country == "St.Vincent & Grenadines"
replace cowcode = 57 if country == "Saint Vincent and the Grenadines"

replace cowcode = 58 if country == "Antigua and Barbuda"
replace cowcode = 58 if country == "Antigua"

replace cowcode=60 if country=="St. Kitts and Nevis"
replace cowcode=60 if country=="St. Kitts & Nevis"

replace cowcode = 70 if country == "Mexico"

replace cowcode = 80 if country == "Belize "
replace cowcode = 80 if country == "Belize"

replace cowcode = 90 if country == "Guatemala"

replace cowcode = 91 if country == "Honduras"

replace cowcode = 92 if country == "El Salvador"
replace cowcode = 92 if country == "El Salvador "


replace cowcode = 93 if country == "Nicaragua"

replace cowcode = 94 if country == "Costa Rica"

replace cowcode = 95 if country == "Panama"

replace cowcode = 100 if country == "Colombia"
replace cowcode = 100 if country == "Columbia"

replace cowcode = 101 if country == "Venezuela"
replace cowcode = 101 if country == "Venezuela, RB"

replace cowcode = 110 if country == "Guyana"

replace cowcode=115 if country=="Suriname"
replace cowcode = 115 if country == "Surinam"
replace cowcode=115 if country=="Suriname "

replace cowcode = 130 if country == "Ecuador"

replace cowcode = 135 if country == "Peru"

replace cowcode = 140 if country == "Brazil"

replace cowcode = 145 if country == "Bolivia"

replace cowcode = 150 if country == "Paraguay"

replace cowcode = 155 if country == "Chile"

replace cowcode = 160 if country == "Argentina"

replace cowcode = 165 if country == "Uruguay"

replace cowcode = 200 if country == "United Kingdom"

replace cowcode = 205 if country == "Ireland"

replace cowcode = 210 if country == "Netherlands"

replace cowcode = 211 if country == "Belgium"

replace cowcode = 212 if country == "Luxembourg"
replace cowcode = 212 if country == "Luxemburg"


replace cowcode = 220 if country == "France"

replace cowcode = 221 if country == "Monaco"

replace cowcode = 223 if country == "Liechtenstein"|country=="Lichtenstein"

replace cowcode = 225 if country == "Switzerland"

replace cowcode = 230 if country == "Spain"

replace cowcode = 232 if country == "Andorra"

replace cowcode = 235 if country == "Portugal"

replace cowcode = 260 if country == "Germany"
replace cowcode = 260 if country=="West Germany"
replace cowcode = 260 if country=="Germany Federal Republic of"
replace cowcode = 260 if country=="Germany Federal Republic"
replace cowcode = 260 if country=="West Germany (FRG)"


replace cowcode=265 if country=="East Germany"
replace cowcode=265 if country=="German Democratic Republic"
replace cowcode=265 if country=="East Germany (GDR)"


replace cowcode = 290 if country == "Poland"
replace cowcode = 290 if country == "Poland "

replace cowcode = 305 if country == "Austria"

replace cowcode = 310 if country == "Hungary"

replace cowcode = 315 if country == "Czech Republic"
replace cowcode = 315 if country == "Czechoslovakia"

replace cowcode = 317 if country == "Slovak Republic"
replace cowcode = 317 if country == "Slovakia"
replace cowcode = 317 if country == "Slovakia "

replace cowcode = 325 if country == "Italy"

replace cowcode=331 if country=="San Marino"

replace cowcode = 338 if country == "Malta"

replace cowcode = 339 if country == "Albania "
replace cowcode = 339 if country == "Albania"


replace cowcode = 343 if country=="Macedonia" 
replace cowcode = 343 if country=="Macedonia, FYR" 

replace cowcode = 344 if country == "Croatia"

replace cowcode = 345 if country == "Yugoslavia"
replace cowcode = 345 if country == "Serbia and Montenegro"
replace cowcode = 345 if country == "Yugoslavia, FR (Serbia/Montenegro)" 
replace cowcode = 345 if country == "Serbia & Montenegro"
replace cowcode = 345 if country == "Serbia-Montenegro"
replace cowcode = 341 if country == "Montenegro"
replace cowcode = 345 if country == "Serbia"

replace cowcode = 346 if country=="Bosnia and Herzegovina "
replace cowcode = 346 if country=="Bosnia and Herzegovina"
replace cowcode = 346 if country=="Bosnia-Herzegovina"

replace cowcode = 349 if country == "Slovenia"

replace cowcode = 350 if country == "Greece"

replace cowcode = 352 if country == "Cyprus"
replace cowcode = 352 if country == "Cyprus "

replace cowcode = 355 if country == "Bulgaria"

replace cowcode = 359 if country=="Moldova" 

replace cowcode = 360 if country == "Romania"

replace cowcode = 365 if country == "Russia"
replace cowcode = 365 if country == "Russian Federation"
replace cowcode = 365 if country=="USSR"
replace cowcode = 365 if country=="Soviet Union"


replace cowcode = 366 if country == "Estonia"

replace cowcode = 367 if country == "Latvia"

replace cowcode = 368 if country == "Lithuania"

replace cowcode = 369 if country == "Ukraine"

replace cowcode = 370 if country == "Belarus"

replace cowcode = 371 if country == "Armenia"

replace cowcode = 372 if country == "Georgia"
replace cowcode = 372 if country == "Georgia "


replace cowcode = 373 if country == "Azerbaijan"

replace cowcode = 375 if country == "Finland"

replace cowcode = 380 if country == "Sweden"

replace cowcode = 385 if country == "Norway"

replace cowcode = 390 if country == "Denmark"

replace cowcode = 395 if country == "Iceland"

replace cowcode = 402 if country == "Cape Verde"

replace cowcode = 403 if country == "Sao Tome and Principe"
replace cowcode = 403 if country == "Sao Tome & Principe"

replace cowcode = 404 if country == "Guinea-Bissau"

replace cowcode = 411 if country == "Equatorial Guinea"

replace cowcode = 420 if country == "Gambia"
replace cowcode = 420 if country=="The Gambia" 
replace cowcode = 420 if country=="Gambia, The" 
replace cowcode = 420 if country == "Gambia "


replace cowcode = 432 if country == "Mali"
replace cowcode = 432 if country == "Mali "


replace cowcode = 433 if country == "Senegal"

replace cowcode = 434 if country == "Benin"

replace cowcode = 435 if country == "Mauritania"

replace cowcode = 436 if country == "Niger"

replace cowcode = 437 if country == "Ivory Coast"
replace cowcode = 437 if country == "Cote d'Ivoire"
replace cowcode = 437 if country == "Cote d`Ivoire"
replace cowcode = 437 if country == "Cote d¥Ivoire"
replace cowcode = 437 if country == "Ivory Coast "


replace cowcode = 438 if country == "Guinea"

replace cowcode = 439 if country == "Burkina Faso"

replace cowcode = 450 if country == "Liberia"

replace cowcode = 451 if country == "Sierra Leone"

replace cowcode = 452 if country == "Ghana"

replace cowcode = 461 if country == "Togo"

replace cowcode = 471 if country == "Cameroon"

replace cowcode = 475 if country == "Nigeria"

replace cowcode = 481 if country == "Gabon"

replace cowcode = 482 if country == "Central African Republic"

replace cowcode = 483 if country == "Chad"

replace country = "Congo Republic" if country=="Congo Republic of"
replace cowcode = 484 if country == "Congo Republic"
replace cowcode = 484 if country == "Congo, Rep."
replace cowcode = 484 if country=="Congo"
replace cowcode= 484 if country=="Congo, Republic of"
replace cowcode= 484 if country== "Congo Republic of the "
replace cowcode= 484 if country== "People's Republic of the Congo"
replace cowcode= 484 if country== "Republic of the Congo"

replace cowcode= 490 if country== "Congo , Democratic Republic"
replace cowcode = 490 if country == "Congo Democratic Republic"
replace cowcode = 490 if country=="Congo Democratic Republic of"
replace cowcode = 490 if country=="Congo, Dem. Rep."|country=="Congo, Democratic Republic Of"
replace cowcode = 490 if country=="Democratic Republic of the Congo"
replace cowcode = 490 if country=="Zaire"



replace cowcode = 500 if country == "Uganda"

replace cowcode = 501 if country == "Kenya"

replace cowcode = 510 if country == "Tanzania"

replace cowcode = 516 if country == "Burundi"

replace cowcode = 517 if country == "Rwanda"
replace cowcode = 517 if country == "Rwanda "

replace cowcode = 520 if country == "Somalia"
replace cowcode = 520 if country == "Somalia "


replace cowcode = 522 if country == "Djibouti"

replace cowcode = 530 if country == "Ethiopia"

replace cowcode = 531 if country == "Eritrea"
replace cowcode = 531 if country == "Eritrea "

replace cowcode = 540 if country == "Angola"

replace cowcode = 541 if country == "Mozambique"

replace cowcode = 551 if country == "Zambia"

replace cowcode = 552 if country == "Zimbabwe"

replace cowcode = 553 if country == "Malawi"

replace cowcode = 560 if country == "South Africa"
replace cowcode = 560 if country == "South Africa"


replace cowcode = 565 if country == "Namibia"

replace cowcode = 570 if country == "Lesotho"

replace cowcode = 571 if country == "Botswana"

replace cowcode = 572 if country == "Swaziland"
replace cowcode = 572 if country == "Swaziland "

replace cowcode = 580 if country == "Madagascar"

replace cowcode = 581 if country == "Comoros"

replace cowcode = 590 if country == "Mauritius"

replace cowcode = 591 if country == "Seychelles"
replace cowcode = 591 if country == "Seychelles "


replace cowcode = 600 if country == "Morocco"

replace cowcode = 615 if country == "Algeria "
replace cowcode = 615 if country == "Algeria"


replace cowcode = 616 if country == "Tunisia"

replace cowcode = 620 if country == "Libya"

replace cowcode = 625 if country == "Sudan"
replace cowcode = 625 if country == "Sudan "

replace cowcode = 626 if country == "South Sudan"


replace cowcode = 630 if country == "Iran"
replace cowcode = 630 if country == "Iran, Islamic Rep."
replace cowcode = 630 if country == "Iran, Islamic Republic"
replace cowcode = 630 if country == "Iran "


replace cowcode = 640 if country == "Turkey"

replace cowcode = 645 if country == "Iraq"

replace cowcode = 651 if country == "Egypt"
replace cowcode = 651 if country == "Egypt, Arab Rep."
replace cowcode = 651 if country == "Egypt, Arab Republic"

replace cowcode = 652 if country == "Syria"
replace cowcode = 652 if country == "Syrian Arab Republic"
replace cowcode = 652 if country == "Syrian Arab Rep."
replace cowcode = 652 if country == "Syria "

replace cowcode = 660 if country == "Lebanon"
replace cowcode = 660 if country == "Lebanon "

replace cowcode = 663 if country == "Jordan"

replace cowcode = 666 if country == "Israel"
replace cowcode = 666 if country == "Israel "


replace cowcode = 670 if country == "Saudi Arabia"
replace cowcode = 670 if country == "Saudi Arabia "

replace cowcode = 690 if country == "Kuwait"
replace cowcode = 690 if country == "Kuwait "


replace cowcode = 692 if country == "Bahrain"

replace cowcode = 694 if country == "Qatar"
replace cowcode = 694 if country == "Qatar "


replace cowcode = 696 if country == "United Arab Emirates"
replace cowcode = 696 if country == "United Arab Emirates "

replace cowcode = 698 if country == "Oman"

replace cowcode = 700 if country == "Afghanistan"

replace cowcode = 701 if country == "Turkmenistan"

replace cowcode = 702 if country == "Tajikistan"
replace cowcode = 702 if country == "Tajikistan "


replace cowcode = 703 if country == "Kyrgyz Republic"
replace cowcode = 703 if country == "Kyrgyzstan"

replace cowcode = 704 if country == "Uzbekistan"

replace cowcode = 705 if country == "Kazakhstan"

replace cowcode = 710 if country == "China"

replace cowcode = 712 if country == "Mongolia"

replace cowcode = 713 if country == "Taiwan"

replace cowcode = 731 if country=="Korea, Dem. Rep."
replace cowcode = 731 if country=="Korea, Democratic Republic"
replace cowcode = 731 if country=="Korea Democratic Republic"
replace cowcode = 731 if country=="Korea, North"

replace cowcode = 732 if country=="Korea Republic of"
replace cowcode = 732 if country=="Korea, Republic of"
replace cowcode = 732 if country=="Korea, Rep."
replace cowcode = 732 if country=="Korea, South"
replace cowcode = 732 if country== "South Korea"

replace cowcode = 740 if country == "Japan"

replace cowcode = 750 if country == "India"

replace cowcode = 760 if country == "Bhutan"

replace cowcode = 770 if country=="Pakistan"

replace cowcode = 771 if country == "Bangladesh"

replace cowcode = 775 if country == "Myanmar"
replace cowcode = 775 if country=="Burma" 

replace cowcode = 680 if country=="Yemen People's Republic" 
replace cowcode= 680 if country=="South Yemen"
replace cowcode = 679 if country=="Yemen" 
replace cowcode = 679 if country=="Yemen, Rep." 
replace cowcode = 679 if country=="Yemen Republic" 

replace cowcode=678 if country=="North Yemen"


replace cowcode = 780 if country == "Sri Lanka"
replace cowcode = 780 if country == "Sri Lanka "


replace cowcode=781 if country=="Maldives"

replace cowcode = 790 if country == "Nepal"

replace cowcode = 800 if country == "Thailand"

replace cowcode = 811 if country == "Cambodia"

replace cowcode = 812 if country == "Laos"
replace cowcode = 812 if country == "Lao PDR"
replace cowcode = 812 if country == "Laos "

replace cowcode = 818 if country == "Vietnam"

replace cowcode = 820 if country == "Malaysia"

replace cowcode = 830 if country =="Singapore"

replace cowcode = 835 if country =="Brunei"|country=="Brunei Darussalam" 

replace cowcode = 840 if country =="Philippines"

replace cowcode = 850 if country =="Indonesia"

replace cowcode=860 if country=="Timor-Leste"
replace cowcode=860 if country=="East Timor"

replace cowcode = 900 if country =="Australia"

replace cowcode = 910 if country =="Papua New Guinea"

replace cowcode = 920 if country =="New Zealand"
replace cowcode = 920 if country =="NewZealand"
replace cowcode = 920 if country =="NewZealand "



replace cowcode = 935 if country =="Vanuatu"

replace cowcode = 940 if country =="Solomon Islands"

replace cowcode = 946 if country=="Kiribati"

replace cowcode = 950 if country =="Fiji"

replace cowcode=955 if country=="Tonga"

replace cowcode=983 if country=="Marshall Islands"

replace cowcode=986  if country=="Palau"

replace cowcode = 987 if country=="Micronesia, Fed. Sts."
replace cowcode = 987 if country=="Micronesia"
replace cowcode = 987 if country=="Federated States of Micronesia"

replace cowcode=990 if country=="Samoa"

replace cowcode=347 if country=="Kosovo"

replace country="Vietnam" if country=="vie"
replace cowcode = 818 if country == "Vietnam"
replace cowcode=. if countryname== "Channel Islands"
destring year, replace
drop if year==.
drop _merge
drop if cowcode==.
save "WB_gender_final.dta", replace

clear
wbopendata, language(en - English) country() topics() indicator(SG.GEN.PARL.ZS) long
label var sg_gen_parl_zs "Prop of lower chamber parliament seats held By Women"
rename sg_gen_parl_zs women_parliament
 kountry countryname, from(other) stuck
 rename _ISO3N_ isocode
 kountry isocode, from(iso3n) to (cown) geo(sov)
gen cowcode= _COWN_
gen country=countryname

replace cowcode=341 if countrycode=="MNE"
replace cowcode=731 if countrycode=="PRK"
replace cowcode=572 if countrycode=="SWZ"
replace cowcode = 260 if country == "Germany"
replace cowcode = 315 if country == "Czech Republic"
 replace cowcode=. if countrycode=="SRB"
replace cowcode = 345 if country == "Serbia"
 replace cowcode = 530 if country == "Ethiopia"
replace cowcode = 626 if country == "South Sudan"
replace cowcode = 818 if country == "Vietnam"
 replace cowcode=347 if country=="Kosovo"
 drop if cowcode==.
save "WB_parliament.dta", replace













































